<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCashiersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cashiers', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('store_id')->index()->nullable()->comment('门店ID');
            $table->string('name', '50')->index()->comment('名字');
            $table->string('number', '50')->index()->comment('员工号');
            $table->string('mobile', '50')->index()->comment('手机号码');
            $table->string('username', '32')->unique()->index()->comment('登陆账号');
            $table->string('password', '255')->comment('登陆密码');
            $table->integer('status')->index()->default(1)->comment('状态1.正常、2.禁用');
            $table->integer('turnover')->index()->default(0)->comment('累计营业额：单位分');
            $table->integer('grand_total')->index()->default(0)->comment('累计营业笔数');
            $table->integer('cash_total')->index()->default(0)->comment('累计收取现金：单位分');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cashiers');
    }
}
